﻿namespace KLF.Lib.Browser.Events
{
    #region Using Statements

    using System;
    using KLF.Lib.Browser.DOM.HTML;

    #endregion

    /// <summary>
    /// The arguments that are associated with the event that fires when an 
    /// error occurrs while processing a block of Javascript.
    /// </summary>
    public class ScriptExceptionArgs : ScriptEventArgs
    {
        #region Using Statements

        public ScriptExceptionArgs(HTMLDocument _doc, HTMLScriptElement _script, Exception _ex)
            : base(_doc, _script)
        {
            Exception = _ex;
            Handled = false;
        }

        #endregion

        #region Attributes

        /// <summary>
        /// The error that was thrown.
        /// </summary>
        public Exception Exception { get; set; }

        /// <summary>
        /// Indicates that the error was handled in some way.
        /// </summary>
        public bool Handled { get; set; }

        #endregion
    }
}
